<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>新建快速定制</title>
    <script src="__PUBLIC__/jquery/jquery.min.js"></script>
    <link rel="stylesheet" href="__PUBLIC__/layui/css/layui.css"  media="all">
    <link rel="stylesheet" href="__PUBLIC__/font-awesome/css/font-awesome.min.css" media="all" />
    <link rel="stylesheet" href="__CSS__/admin.css"  media="all">
</head>
<style>
    /*.page1{*/
        /*display: none;*/
    /*}*/
    .layui-input-block{
        /*margin-left: 40px;*/
    }
    .searchs{
        position: absolute;
        right: 200px;
    }
    .travel_list{
        height:200px;
        margin-left: 30px;
        margin-right: 30px;
        overflow-y: scroll;
    }

    .travel_tit{
        margin-left: 30px;
        margin-right: 30px;
    }
    .layui-table thead tr{
        background: #e6e6e6;
    }
    .page4-box{
        padding: 12px 16px;
    }
    .query-box{
        padding:20px 20px 10px 20px ;
        /*padding-top:20px;*/
        border: 1px solid #e6e6e6;
        min-height: 45px;
    }
    .selected_trip{
        border: 1px solid #e6e6e6;
    }
    .tripspan{
        margin-left: 40px;
        margin-right: 30px;
    }
    .tripspan span{
        line-height: 38px;
        background: #00a0e9;
        padding: 5px;
        border-radius: 10px;
        color: #fff;
    }
    .tag{
        float: left;
    }
    /*上一步下一步按钮居中*/
    .butcent{
        position: absolute;
        bottom: 20px;
        left: 40%;
        margin-left: 30%;
        width:20%;
        /*margin: 30px;*/
        padding: 30px;
    }

    .butcent2{
        margin-left: 70%;
        width:20%;
        padding: 30px;
    }

    .picturebut{
        /*background-color: #fbfdff;*/
        border: 1px solid #c0ccda;
        border-radius: 6px;
        box-sizing: border-box;
        font-size:22px;
        width:48%;
        height: 100%;
        margin-top:-10%;
        margin-left:-8%;
        cursor: pointer;
        line-height: 300px;
        vertical-align: top;
    }
    .page3{
        margin-left: 16%;
        margin-top: 20%;
    }
    .layui-form-select .layui-edge{
        display: none;
        right: 0;
    }
    th{
        text-align: left;
    }
    .layui-input{
        border-radius: 5px;
    }

</style>
<body>

<!--客户信息的弹窗的内容数据-->
<div>
    <form class="layui-form " id="tripconfig" action="">
        <div class="page1">
            <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
                <legend>行程配置信息</legend>
            </fieldset>
            <div class="layui-form-item ">
                <div class="layui-inline">
                    <div class="layui-form-item layui-form-text">
                        <label class="layui-form-label">简介</label>
                        <div class="layui-input-block" style="max-width:500px;">
                            <textarea placeholder="请输入内容"  class="layui-textarea" id="introduce" name="introduction">{notempty name='$trip'}{$trip.introduction}{/notempty}</textarea>
                        </div>
                    </div>
                    <div class="layui-form-item layui-form-text">
                        <label class="layui-form-label">定制说明</label>
                        <div class="layui-input-block" style="max-width:500px;">
                            <textarea placeholder="请输入设计理念和对客户的价值说明，要求有温度，有内涵"  class="layui-textarea" id="custom_made_description" name="custom_made_description">{notempty name='$trip'}{$trip.custom_made_description}{/notempty}</textarea>
                        </div>
                    </div>
                    <div class="layui-form-item layui-form-text">
                        <label class="layui-form-label">费用包含</label>
                        <div class="layui-input-block" style="max-width:500px;">
                            <textarea placeholder="请输入内容" class="layui-textarea"  id="introduce2" name="price">{notempty name='$trip'}{$trip.price}{/notempty}</textarea>
                        </div>
                    </div>

                    <div class="layui-form-item layui-form-text">
                        <label class="layui-form-label">费用不含</label>
                        <div class="layui-input-block" style="max-width:500px;">
                            <textarea placeholder="请输入内容" class="layui-textarea"  id="introduce3" name="priceno">{notempty name='$trip'}{$trip.priceno}{/notempty}</textarea>
                        </div>
                    </div>

                    <div class="layui-form-item layui-form-text">
                        <label class="layui-form-label">注意事项</label>
                        <div class="layui-input-block" style="max-width:500px;">
                            <textarea placeholder="请输入内容" class="layui-textarea" id="introduce4" name="careful">{notempty name='$trip'}{$trip.careful}{/notempty}</textarea>
                        </div>
                    </div>

                    <div class="layui-form-item layui-form-text">
                        <label class="layui-form-label">退改规则</label>
                        <div class="layui-input-block" style="max-width:500px;">
                            <textarea placeholder="请输入内容" class="layui-textarea"  id="introduce5" name="back">{notempty name='$trip'}{$trip.back}{/notempty}</textarea>
                        </div>
                    </div>
                    <div class="layui-upload" id="upload-thumb">
                        <label class="layui-form-label">展示图片</label>
                        <button type="button" class="layui-btn" id="thumb">上传</button>
                        <div class="layui-upload-list">
                            <label class="layui-form-label"></label>
                            <img class="layui-upload-img" id="demo1" width="150" height="150" {notempty name="$trip.trip_banner"}src="{$trip.trip_banner}"{/notempty}>
                            <p id="demoText"></p>
                        </div>
                    </div>
                    <!--<label class="layui-form-label"><span style="color: red">*</span>&nbsp;</label>-->
                    <div class="layui-form-item layui-form-text">
                        <label class="layui-form-label">方案配置</label>
                        <div class="layui-input-block" style="margin-top:8px;">
                            <input type="checkbox" name="show_city_map" title="总行程地图"{if $trip.show_city_map=='1'}checked=""{/if}>
                            <input type="checkbox" name="show_day_map" title="每日地图"{if $trip.show_day_map=='1'}checked=""{/if}>
                            <input type="checkbox" name="showintroduction" title="简介" {if $trip.showintroduction!='0'}checked=""{/if}>
                            <input type="checkbox" name="showpricedetail" title="报价明细" {if $trip.showpricedetail!='0'}checked=""{/if}>
                            <input type="checkbox" name="showprice" title="费用说明" {if $trip.showprice!='0'}checked=""{/if}>
                            <input type="checkbox" name="showcareful" title="注意事项" {if $trip.showcareful!='0'}checked=""{/if}>
                            <input type="checkbox" name="showback" title="退改规则" {if $trip.showback!='0'}checked=""{/if}>
                            <input type="checkbox" name="allow_everyone_import" title="允许引用" {if $trip.allow_everyone_import!='0'}checked=""{/if}>
                        </div>
                    </div>
                    <div class="layui-form-item layui-form-text">
                        <label class="layui-form-label">POI配置</label>
                        <div class="layui-input-block" style="margin-top:8px;">
                            <input type="checkbox" name="showmobile" title="联系方式" {if $trip.showmobile=='1'}checked=""{/if}>
                            <input type="checkbox" name="showticket" title="门票信息" {if $trip.showticket=='1'}checked=""{/if}>
                            <input type="checkbox" name="showopen_time" title="开放时间" {if $trip.showopen_time=='1'}checked=""{/if}>
                            <input type="checkbox" name="showticket_url" title="订票官网"  {if $trip.showticket_url=='1'}checked=""{/if}>
                            <input type="checkbox" name="showpoicontent" title="中文介绍" {if $trip.showpoicontent=='1'}checked=""{/if}>
                            <input type="checkbox" name="showeng_introduce" title="英文介绍" {if $trip.showeng_introduce=='1'}checked=""{/if}>
                            <input type="checkbox" name="showdescription" title="特别说明" {if $trip.showdescription=='1'}checked=""{/if}>
                            <input type="checkbox" name="showcontent" title="备注" {if $trip.showcontent=='1'}checked=""{/if}>
                            <input type="checkbox" name="showthumb" title="图片" {if $trip.showthumb!='0'}checked=""{/if}>
                            <input type="checkbox" name="showsource" title="来源" {if $trip.showsource=='1'}checked=""{/if}>
                            <input type="checkbox" name="showaddress" title="地址" {if $trip.showaddress!='0'}checked=""{/if}>
                            <input type="checkbox" name="showgrade" title="星级"{if $trip.showgrade=='1'}checked=""{/if}>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </form>

    <div class="layui-form-item">
        <div class="container">
            <div class="page1" style="text-align:center;">
                <button class="layui-btn" lay-submit lay-filter="updTripCfg">提交</button>
            </div>
        </div>
    </div>
</div>
</body>

<script src="__PUBLIC__/layui/layui.js"></script>
<script src="__PUBLIC__/jquery/jquery.min.js"></script>
<script>
    layui.config({
        base : '__PUBLIC__/'
    }).extend({
        selectM: './multiple/selectM',
    }).use(['layer','form','jquery','selectM','laydate','table','upload'],function() {
        var layer = layui.layer,
            $ = layui.jquery,
            form = layui.form,
            upload = layui.upload,
            selectM = layui.selectM,
            laydate = layui.laydate,
            table = layui.table;
        laydate.render({     //创建时间选择框
            elem: '#start_go_time' //指定元素
            , format: 'yyyy-MM-dd'
        });
        //执行实例
        var uploadInst = upload.render({
            elem: '#thumb' //绑定元素
            ,url: "{:url('common/upload')}" //上传接口
            ,done: function(res){
                //上传完毕回调
                layer.closeAll('loading');
                if(res.code == 2) {
                    $('#demo1').attr('src',res.src);
                    $('#upload-thumb').append('<input type="hidden" name="trip_banner" value="'+ res.src +'">');
                } else {
                    layer.msg(res.msg);
                }
            }
            ,error: function(){
                //请求异常回调
                layer.closeAll('loading');
                //演示失败状态，并实现重传
                var demoText = $('#demoText');
                demoText.html('<span style="color: #FF5722;">上传失败</span> <a class="layui-btn layui-btn-mini demo-reload">重试</a>');
                demoText.find('.demo-reload').on('click', function(){
                    uploadInst.upload();
                });
            }
            ,before:function(){
                layer.load(2); //上传loading
            }

        });
        form.on('submit(updTripCfg)', function (data) {
            $.ajax({
                url: "{:url('admin/quicktrip/tripconfig',['id'=>$trip['id']])}",
                data: $('#tripconfig').serialize(),
                type: 'post',
                async: false,
                success: function (res) {
                    var id = res.data;
                    parent.$("#tripid").attr("value", id);
                    layer.msg(res.msg);
                    if (res.code == 1) {
                        setTimeout(function () {
                            var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
                            parent.layer.close(index); //再执行关闭
                        }, 1500)
                    }
                }
            })
        });
    })
</script>
<!-- 配置文件 -->
<script type="text/javascript" src="__PUBLIC__/ueditor/ueditor.config.js"></script>
<!-- 编辑器源码文件 -->
<script type="text/javascript" src="__PUBLIC__/ueditor/ueditor.all.js"></script>
<!-- 实例化编辑器 -->
<script type="text/javascript">
    var ue = UE.getEditor('introduce',{
        initialFrameHeight: 100,
        initialFrameWidth: 500,
        toolbars:[
            ['fullscreen', 'source', 'undo', 'redo'],
            ['bold', 'italic', 'underline', 'fontborder', 'strikethrough', 'superscript', 'subscript', 'removeformat', 'formatmatch', 'autotypeset', 'blockquote', 'pasteplain', '|', 'forecolor', 'backcolor', 'insertorderedlist', 'insertunorderedlist', 'selectall', 'cleardoc']
        ]
    });
    var ue2 = UE.getEditor('introduce2',{
        initialFrameHeight: 100,
        initialFrameWidth: 500,
        toolbars:[
            ['fullscreen', 'source', 'undo', 'redo'],
            ['bold', 'italic', 'underline', 'fontborder', 'strikethrough', 'superscript', 'subscript', 'removeformat', 'formatmatch', 'autotypeset', 'blockquote', 'pasteplain', '|', 'forecolor', 'backcolor', 'insertorderedlist', 'insertunorderedlist', 'selectall', 'cleardoc']
        ]
    });
    var ue3 = UE.getEditor('introduce3',{
        initialFrameHeight: 100,
        initialFrameWidth: 500,
        toolbars:[
            ['fullscreen', 'source', 'undo', 'redo'],
            ['bold', 'italic', 'underline', 'fontborder', 'strikethrough', 'superscript', 'subscript', 'removeformat', 'formatmatch', 'autotypeset', 'blockquote', 'pasteplain', '|', 'forecolor', 'backcolor', 'insertorderedlist', 'insertunorderedlist', 'selectall', 'cleardoc']
        ]
    });
    var ue4 = UE.getEditor('introduce4',{
        initialFrameHeight: 100,
        initialFrameWidth: 500,
        toolbars:[
            ['fullscreen', 'source', 'undo', 'redo'],
            ['bold', 'italic', 'underline', 'fontborder', 'strikethrough', 'superscript', 'subscript', 'removeformat', 'formatmatch', 'autotypeset', 'blockquote', 'pasteplain', '|', 'forecolor', 'backcolor', 'insertorderedlist', 'insertunorderedlist', 'selectall', 'cleardoc']
        ]
    });
    var ue5 = UE.getEditor('introduce5',{
        initialFrameHeight: 100,
        initialFrameWidth: 500,
        toolbars:[
            ['fullscreen', 'source', 'undo', 'redo'],
            ['bold', 'italic', 'underline', 'fontborder', 'strikethrough', 'superscript', 'subscript', 'removeformat', 'formatmatch', 'autotypeset', 'blockquote', 'pasteplain', '|', 'forecolor', 'backcolor', 'insertorderedlist', 'insertunorderedlist', 'selectall', 'cleardoc']
        ]
    });
    var ue6 = UE.getEditor('custom_made_description',{
        initialFrameHeight: 100,
        initialFrameWidth: 500,
        toolbars:[
            ['fullscreen', 'source', 'undo', 'redo'],
            ['bold', 'italic', 'underline', 'fontborder', 'strikethrough', 'superscript', 'subscript', 'removeformat', 'formatmatch', 'autotypeset', 'blockquote', 'pasteplain', '|', 'forecolor', 'backcolor', 'insertorderedlist', 'insertunorderedlist', 'selectall', 'cleardoc']
        ]
    });
</script>
</html>